package com.thinksns.sociax.listener;

import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;

/**
 * Created by zhiyicx on 2017/5/15.
 */

public abstract class BlankTextSwitcher implements TextWatcher {

    @Override
    public void beforeTextChanged(CharSequence s, int start, int count, int after) {

    }

    @Override
    public void onTextChanged(CharSequence s, int start, int before, int count) {
        if (TextUtils.isEmpty(s)) {
            onTextBlank();
        } else {
            onTextNotBlank();
        }
    }

    @Override
    public void afterTextChanged(Editable s) {

    }

    protected abstract void onTextBlank();

    protected abstract void onTextNotBlank();
}
